package com.ef.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.ef.constant.EGenderType;
import com.ef.constant.StatusType;

@Entity
public class PTE implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	@Enumerated(value = EnumType.STRING)
	private StatusType status = StatusType.VALID;
	
	/**
	 * PTE的编码
	 */
	@Column(length = 100)
	private String worknumber;

	@Column(length = 100)
	private String name;

	@Column(length = 100)
	private String telephone;

	@Column(length = 100)
	private String email;

	@Column(length = 200)
	private String address;

	@Column(length = 500)
	private String comments;

	@Enumerated(value = EnumType.STRING)
	private EGenderType gender;

	@ManyToOne(fetch = FetchType.LAZY)
	private User updateUser;

	@Temporal(TemporalType.TIMESTAMP)
	private Date updateTime;
	
	@ManyToOne(fetch = FetchType.LAZY)
	private Team team;
	
	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public EGenderType getGender() {
		return gender;
	}

	public void setGender(EGenderType gender) {
		this.gender = gender;
	}

	public StatusType getStatus() {
		return status;
	}

	public void setStatus(StatusType status) {
		this.status = status;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	@Override
	public boolean equals(Object obj) {
		if (obj!=null&&obj instanceof PTE){
			PTE t=(PTE)obj;
			if (this.id==null&&t.id==null){
				return true;
			}
			if (this.id==null||t.id==null){
				return false;
			}
			return this.getId().equals(t.getId());
		}
		return false;
	}

	public String getWorknumber() {
		return worknumber;
	}

	public void setWorknumber(String worknumber) {
		this.worknumber = worknumber;
	}

	public User getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(User updateUser) {
		this.updateUser = updateUser;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
 
}
